/*jslint vars: true, forin: true, sloppy: true, plusplus: true */
var probe = require('../../global');
probe.service('simulight', function () {
	var angular = require('angular');

	return function (objectDOM, contextFrame) {
		var $area = angular.element('<div class="trigger area"></div>'),
			frameOffset = contextFrame.getBoundingClientRect(),
			offset = objectDOM.getBoundingClientRect();

		$area.css({
			top: (offset.top + frameOffset.top - 2) + 'px',
			left: (offset.left + frameOffset.left - 2) + 'px',
			width: offset.width + 'px',
			height: offset.height + 'px',
			'background-color': 'rgba(96, 209, 251, 0.9)'
		});

		angular.element(document.body).append($area);

		setTimeout(function () {
			$area.css({'background-color': 'transparent'});
		}, 500);

		setTimeout(function () {
			$area.remove();
		}, 1500);
	};
});
